"Bazel dependencies"

module(
    name = "toolchains_protoc",
    version = "0.3.1",
    compatibility_level = 1,
)

bazel_dep(name = "bazel_features", version = "1.9.0")
bazel_dep(name = "bazel_skylib", version = "1.4.1")
bazel_dep(name = "rules_proto", version = "6.0.0")
bazel_dep(name = "platforms", version = "0.0.10")

protoc = use_extension("//protoc:extensions.bzl", "protoc")
protoc.toolchain(
    google_protobuf = "com_google_protobuf",
    version = "LATEST",
)
use_repo(protoc, "com_google_protobuf", "toolchains_protoc_hub")

register_toolchains("@toolchains_protoc_hub//:all")

# Assert no CC compilation occurs
register_toolchains(
    "//tools/toolchains:all",
    dev_dependency = True,
)

bazel_dep(name = "aspect_bazel_lib", version = "1.32.1", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "6.1.2", dev_dependency = True)
bazel_dep(name = "aspect_rules_py", version = "0.7.1", dev_dependency = True)
bazel_dep(name = "rules_java", version = "7.4.0", dev_dependency = True)
bazel_dep(name = "rules_python", version = "0.32.2", dev_dependency = True)
bazel_dep(name = "rules_go", version = "0.48.0", dev_dependency = True)
bazel_dep(name = "rules_uv", version = "0.10.0", dev_dependency = True)

register_toolchains(
    "//examples/lang_toolchains:all",
    dev_dependency = True,
)

# Shows how a typical Python user fetches all the dependencies of their app, including the protobuf runtime
dev_pip = use_extension(
    "@rules_python//python/extensions:pip.bzl",
    "pip",
    dev_dependency = True,
)
dev_pip.parse(
    hub_name = "pypi",
    python_version = "3.11",
    requirements_lock = "//examples/lang_toolchains:requirements.txt",
)
use_repo(dev_pip, "pypi")
